home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
271_02
/
chkasync.doc
< prev
next >
Wrap
Text File
|
1987-08-18
|
1KB
|
46 lines
NAME
chkdcd -- check state of carrier detect flag
chkdsr -- check state of data set ready flag
chkcts -- check state of clear to send flag
chkring -- check state of ring indicator flag
SYNOPSIS
r = chkdcd(port);
r = chkdsr(port);
r = chkcts(port);
r = chkring(port);
int r; TRUE or FALSE, depending upon state
int port; 0, 1, 2, or 3 (for COM1-COM4)
DESCRIPTION
These are assembly language functions which provide direct
access to the serial communications chips for the fastest
access possible. Each function checks a particular
communications flag and returns its state as TRUE (on) or
FALSE (off).
The port parameter may be specified as integers 0-3, or
SER1 to SER4 as defined in <smdefs.h>.
EXAMPLE
int sport; /* serial port */
sport = SER2; /* let it point to COM2 */
if(chkdcd(sport)) puts("We have a carrier detected");
else puts("The modem is apparently idle");
This function is found in SMTCx.LIB for the Turbo-C Compiler